package com.evl.constant;

import com.evl.common.constant.Const;

/**
 * 用户的状态
 *
 * @author fengshuonan
 * @Date 2017年1月22日 下午12:14:59
 */
public enum TrainTicketStatus {

	LOCKED(Const.TRAIN_TICKET_LOCKED, "已锁定"),
	TOBEUSED(Const.TRAIN_TICKET_TOBEUSED, "待使用"),
	ENDORSE(Const.TRAIN_TICKET_ENDORSE, "已改签"),
	REFUND(Const.TRAIN_TICKET_REFUND, "已退票"),
	PULLIN(Const.TRAIN_TICKET_PULLIN, "已进站"),
	REFUNDING(Const.TRAIN_TICKET_REFUNDING, "退票审核中");
	
    int code;
    String name;

    TrainTicketStatus(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String valueOf(Integer status) {
        if (status == null) {
            return "";
        } else {
            for (TrainTicketStatus s : TrainTicketStatus.values()) {
                if (s.getCode() == status) {
                    return s.getName();
                }
            }
            return "";
        }
    }

}
